<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property int $scheme_id 方案ID
 * @property string $send_time 发送时间
 * @property int $contact_cnt 受众用户
 * @property array $content 发送内容
 * @property int $status 状态：0=发送中 1=发送完成 2=暂停中 3=已取消
 * @property string $created_at 
 * @property string $update_at 
 */
class ChSmartPushSchemeTask extends MineModel
{
    public bool $timestamps = false;
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_smart_push_scheme_task';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'scheme_id', 'send_time', 'contact_cnt', 'content', 'status', 'created_at', 'update_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer', 'scheme_id' => 'integer', 'contact_cnt' => 'integer', 'content' => 'array', 'status' => 'integer'];

    /**
     * 方案
     * @return \Hyperf\Database\Model\Relations\HasOne
     */
    public function scheme(): \Hyperf\Database\Model\Relations\HasOne
    {
        return $this->hasOne(ChSmartPushScheme::class, 'id', 'scheme_id');
    }
}
